import java.util.Scanner;

public class huiwen {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n > 5 ){
            return;
        }
        String[] str = new String[n];
        for (int i = 0; i < n; i++) {
            str[i] = sc.next();
        }
        int count = 0;
        for (int i = 0; i < n; i++) {
            ishuiwen(str[i]);
            if (count != 0) {
                System.out.println("");
            }
            count++;
            if (ishuiwen(str[i])) {
                System.out.print("YES");
            }else {
                System.out.print("NO");
        }
        }
            sc.close();
    }
    private static boolean ishuiwen(String str) {
        String string = str.toLowerCase();
        int left = 0;
        int right = string.length() - 1;
        while (left < right) {
            if (string.charAt(left) != string.charAt(right)) {
                return false;
            }
            left++;
            right--;
        }
        return true;

    }
}
